package People;

import java.io.Serializable;

public class People implements Serializable {
    public int id;
    public String name;
    public String gender;
    private String major1;
    protected String major2;
    String Major3;
    public int getID() {
        return id;
    }
    public void setID(int id) {
        this.id=id;
    }
    public String getName() {
        return name;
    }
    public void setName(String name) {
        this.name=name;
    }
    public String getGender() {
        return gender;
    }
    public void setGender(String gender) {
        this.gender=gender;
    }
    private String getMajor1(){
        return major1;
    }
    protected String getMajor2(){
        return major2;
    }
    //String Major3（）{
    //   return Major3;
    //}
//    public static void main(String[] args) {
//        People P1 = new People();
//        System.out.println("P1 实例访问："+P1.id);
//        System.out.println("P1 实例访问："+P1.getID());
//        //父类内部可以访问新建父类对象属性
//    }
    @Override
    public String toString() {
        return "id:" + this.id + " name:" + this.name + " gender:" + this.gender;
    }
}
